<?php include_template('header');?>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" valign="top">
	<a href="<?php echo $config['site_url'];?>/editprofile.php">EditProfile</a><br>
	<a href="<?php echo $config['site_url'];?>/add_topic.php">SubmitTopic</a><br>
	<a href="<?php echo $config['site_url'];?>/logout.php">Logout</a><br>
      <br>
	  <strong>Categories</strong><br>
      <br>
	  <a href="<?php echo $config['site_url'];?>">View All</a><br>
      <?php cat_list();?>
	  <br>
    <br></td>
    <td valign="top"><strong>Add Topic</strong><br>
    <br>
    <form name="add_story" id="add_story" method="post" action="add_topic.php" style="padding:0px;margin:0px;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td><strong>Topic URL</strong></td><td align="right">以http://开头</td>
            </tr></table></td>
        </tr>
        <tr>
          <td><input name="url" type="text" id="url" value="http://" style="width:500px;" maxlength="80"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td><strong>Topic Title</strong></td><td align="right"></td>
            </tr></table></td>
        </tr>
        <tr>
          <td><input name="title" type="text" id="title" value="" style="width:500px;" maxlength="80"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td><strong>Topic Description</strong></td><td align="right"></td>
            </tr></table></td>
        </tr>
        <tr>
          <td><textarea name="description" rows="6" id="description" style="width:500px;" ></textarea></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><strong>Topic Category</strong></td>
        </tr>
        <tr>
          <td>
		  <table border="0" cellpadding="0" cellspacing="0">
		  <?php 
		  include_logic('cat');
		  $cats = cat_find();
		  foreach($cats as $cat){
		  ?>
		  <tr><td align="left"><input name="cat_id" id="cat_id" type="radio" value="<?php echo $cat['_id'];?>"></td><td><?php echo $cat['name'];?></td></tr>
		  <?php } ?>
		</table>
		  </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><input type="submit" name="Submit" value="Submit Topic">
        </tr>
      </table>
    </form></td>
  </tr>
  </table>
<?php include_template('footer');?>